<template>
	<view style="height: 100vh; background-color: #FFFFFF;">
		<u-navbar title-color="#FFFFFF" height="48" back-icon-color="#FFFFFF" :border-bottom="false" :is-fixed="true" title="巡检记录详情">
		</u-navbar>	
		<uc-content :loading="loading">
			<view class="list-item">
				<view class="list-bottom">
					<view>巡检名称:</view>
					<view>{{inspectionInfo.taskName}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>巡检人:</view>
					<view>{{inspectionInfo.userName}}</view>
				</view>
			</view>
			<view class="list-item" v-if="inspectionInfo.abnormalNum!=null">
				<view class="list-bottom">
					<view>异常设备数量:</view>
					<view>{{inspectionInfo.abnormalNum}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>巡检次数:</view>
					<view>第{{inspectionInfo.frequency}}次巡检</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>巡检描述:</view>
					<view>{{inspectionInfo.remark}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>开始时间:</view>
					<view>{{inspectionInfo.startTime|dateFormat}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>结束时间:</view>
					<view>{{inspectionInfo.endTime|dateFormat}}</view>
				</view>
			</view>
		</uc-content>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading: false,
				inspectionInfo: {
					ucId: '',
				},
				
			}
		},
		onLoad(e) {
			this.ucId = e.ucId
		},
		onShow() {
			this.loading = true
			this.getInInspectionLogVo(this.ucId)
		},
		methods: {
			getInInspectionLogVo(val) {
				this.utils.request("/api/app/inInspectionLog/getInInspectionLogVo", {
					ucId: val
				}, "post", "app", true).then(res => {
					console.log(res)
					this.loading = false
					this.inspectionInfo = res.data
				}).catch(error => {
					this.loading = false
					console.log(error)
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/uview-ui/libs/css/style.components.scss";

	.list-item {
		padding: 20rpx 40rpx;
		background-color: #fff;
		border-bottom: #999999 1px dashed;

		.list-bottom {
			display: flex;
			margin-top: 10rpx;
			font-size: 28rpx;
			justify-content: space-between;
			color: #333;
		}

		.list-center {
			margin-top: 20rpx;
			font-size: 28rpx;
			color: #999999;
		}
	}
</style>
